Some migrateWarn() calls (like the one for compatMode) happen before
mw is created. Don't crash on trying to call mw.track() in that case.
Change-Id: I9e33af2865bb10adc0473045f714fe4f9f699861
warnedAbout[ msg ] = true;
jQuery.migrateWarnings.push( msg );
// PATCH: Add instrumentation for statistics --Krinkle
- mw.track( "mw.deprecate", "jquery-migrate" );
+ if ( window.mw && window.mw.track ) {
+ window.mw.track( "mw.deprecate", "jquery-migrate" );
+ }
if ( console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
if ( jQuery.migrateTrace && console.trace ) {